package com.corewillsoft.fireflies.gameobjects.obstacles;

import java.util.Arrays;
import java.util.List;

import com.corewillsoft.fireflies.gamelaws.LawType;
import com.corewillsoft.fireflies.gameobjects.fireflyraces.Color;

public class Wall extends Obstacle {
	/**
	 * Default height of the wall
	 */
	private static final float WALL_HEIGHT = 120f;

	/**
	 * Default width of the wall
	 */
	private static final float WALL_WIDTH = 120f;

	/**
	 * Default color of the wall
	 */
	private static final Color WALL_COLOR = new Color(0.5f, 0.5f, 0.5f);

	private static final float DURABITY_RATIO = 0.1f;
	private static final List<LawType> createdLaws = Arrays
			.asList(LawType.WALL_FIREFLY);
	private static final List<LawType> supportedLaws = Arrays.asList();

	private float mDurabity = 1.0f;

	public Wall() {
		super();
		init();
	}

	public Wall(int x, int y) {
   		super(x, y);
		init();
	}

	private void init() {
		setWidth(WALL_WIDTH);
		setHeight(WALL_HEIGHT);
		setColor(WALL_COLOR.getRed(), WALL_COLOR.getGreen(), WALL_COLOR.getBlue());
	}

	@Override
	public void updateState() {
		// Log.d("Obstacle", "WALL. I'm not moving...");
	}

	public float getDurabity() {
		return mDurabity;
	}

	public void decreaseDurabity() {
		// Log.d("Obstacle", "durabity is " + mDurabity);
		mDurabity -= DURABITY_RATIO;
		/*
		 * if (mDurabity <= 0) Log.d("Obstacle", "WALL has crashed!!!");
		 */
	}

	@Override
	public ObstacleType getType() {
		return ObstacleType.WALL;
	}

	@Override
	public boolean isActive() {
		return true;
	}

	@Override
	protected List<LawType> getSupportedLaws() {
		return supportedLaws;
	}

	@Override
	protected List<LawType> getCreatedLaws() {
		return createdLaws;
	}
}
